<style>
  .layui-table-cell .layui-table-sort {
    display: none;
  }

  .lay-query-box .query-lt {
    width: 90%;
  }

  .layui-table-view .layui-table-tool-self {
    display: flex;
    justify-content: flex-end;
    position: initial;
    margin-top: 12px;
  }
</style>

<!-- 正文开始 -->
<div class="layui-fluid">
  <div class="layui-card">
    <div class="layui-card-body">
      <!-- 头部操作栏 -->
      <div class="layui-form lay-header">
        <div class="toolbar">
          <div class="layui-form-item lay-query-content">
            <div class="lay-query-box">
              <div class="query-lt">
                <div class="layui-inline">
                  <label class="layui-form-label">所属工单：</label>
                  <div class="layui-input-inline">
                    <input name="workOrderCode" id="workOrderCode" class="layui-input" type="text" placeholder="请输入所属工单" autocomplete="off" />
                  </div>
                </div>

                <div class="layui-inline">
                  <label class="layui-form-label">出库任务单编号：</label>
                  <div class="layui-input-inline">
                    <input name="workOrderCode2" id="workOrderCode2" class="layui-input" type="text" placeholder="请输入出库任务单编号" autocomplete="off" />
                  </div>
                </div>
                <!--<div class="layui-inline">
                  <label class="layui-form-label w-auto">出库类型：</label>
                  <div class="layui-input-inline mr0">
                    <select id="inventoryTypeId" name="inventoryTypeId" lay-filter=""></select>
                  </div>
                </div>-->
                <!--<div class="layui-inline">
                  <label class="layui-form-label w-auto">状态：</label>
                  <div class="layui-input-inline mr0">
                    <select id="status" name="status" lay-filter="">
                      <option value="">请选择</option>
                      <option value="2">待领料</option>
                      <option value="3">领料完成</option>
                    </select>
                  </div>
                </div>-->
                <div class="layui-inline">
                  <label class="layui-form-label w-auto">创建时间：</label>
                  <div class="layui-input-inline">
                    <input id="pTime" class="layui-input date-icon" type="text"
                           placeholder="选择创建时间"
                           autocomplete="off" readonly/>
                    <input name="startCreateTime" id="startCreateTime" style="display: none"/>
                    <input name="endCreateTime" id="endCreateTime" style="display: none"/>
                  </div>
                </div>
              </div>
              <div class="query-rt">
                <div class="layui-inline">
                  <button class="layui-btn icon-btn color-green" lay-filter="formSubSearchLog" lay-submit layui-form-keyDownSearch="true">查询</button>
                  <button class="layui-btn icon-btn color-white" lay-filter="resets" lay-submit>重置</button>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="lay-btn-rows">
          <div class="lay-btn-box">
            <div class="lay-btn-lt"></div>
          </div>
        </div>
      </div>
      <!-- 表格 -->

      <div class="table-bor">
        <button id="configFunByapply" style="display: none" class="layui-btn icon-btn color-reseda" type="button">确认选择</button>
        <table class="layui-table" id="receiptApplyTable" lay-filter="receiptApplyTable"></table>
      </div>
    </div>
  </div>
</div>

<!-- 表格操作列 -->
<script type="text/html" id="receiptApplyTabBar">
  <a class="layui-btn layui-btn-xs " lay-event="outbound">出库作业</a>
  <a class="layui-btn layui-btn-xs layui-btn-primary" lay-event="detail">详情</a>
</script>

<!-- 领料申请单审核、详情弹窗 -->
<script type="text/html" id="receiptApplyEditForm">
  <form lay-filter="receiptApplyEditForm" class="layui-form open-form">
    <div class="open-model">
      <div class="open-auto">
        <input name="id" type="hidden" />
        <div class="layui-col-xs4">
          <div class="layui-form-item">
            <label class="layui-form-label">领料类型</label>
            <div class="layui-input-block">
              <input name="inventoryTypeName" type="text" class="layui-input" readonly />
            </div>
          </div>
        </div>
        <div class="layui-col-xs4">
          <div class="layui-form-item">
            <label class="layui-form-label">开工单编号</label>
            <div class="layui-input-block">
              <input name="workOrderCode" type="text" class="layui-input" readonly />
            </div>
          </div>
        </div>
        <!--                <div class="layui-col-xs4">-->
        <!--                    <div class="layui-form-item">-->
        <!--                        <label class="layui-form-label">制造令编号</label>-->
        <!--                        <div class="layui-input-block">-->
        <!--                            <input name="processCode" type="text" class="layui-input" readonly/>-->
        <!--                        </div>-->
        <!--                    </div>-->
        <!--                </div>-->
        <div class="layui-col-xs4">
          <div class="layui-form-item">
            <label class="layui-form-label">所属计划</label>
            <div class="layui-input-block">
              <input name="productionPlanCode" type="text" class="layui-input" readonly />
            </div>
          </div>
        </div>
        <div class="layui-col-xs4">
          <div class="layui-form-item">
            <label class="layui-form-label">仓库类型</label>
            <div class="layui-input-block">
              <input name="warehouseTypeName" type="text" class="layui-input" readonly />
            </div>
          </div>
        </div>
        <div class="layui-col-xs4">
          <div class="layui-form-item">
            <label class="layui-form-label">领料仓库</label>
            <div class="layui-input-block">
              <input name="receiptWarehouseName" type="text" class="layui-input" readonly />
            </div>
          </div>
        </div>
        <div class="layui-col-xs4">
          <div class="layui-form-item">
            <label class="layui-form-label">领料料号数</label>
            <div class="layui-input-block">
              <input name="receiptNum" type="text" class="layui-input" readonly />
            </div>
          </div>
        </div>
        <div class="layui-col-xs4">
          <div class="layui-form-item">
            <label class="layui-form-label">审核人</label>
            <div class="layui-input-block">
              <input name="auditPersonName" type="text" class="layui-input" readonly />
            </div>
          </div>
        </div>
        <div class="layui-col-xs4">
          <div class="layui-form-item">
            <label class="layui-form-label">领料人</label>
            <div class="layui-input-block">
              <input name="creatorName" type="text" class="layui-input" readonly />
            </div>
          </div>
        </div>
        <div class="layui-col-xs4">
          <div class="layui-form-item">
            <label class="layui-form-label">描述</label>
            <div class="layui-input-block">
              <input name="remark" type="text" class="layui-input" />
            </div>
          </div>
        </div>
        <div class="layui-col-xs4">
          <div class="layui-form-item">
            <label class="layui-form-label">审核结果</label>
            <div class="layui-input-block">
              <input name="auditResult" type="text" maxlength="200" class="layui-input" />
            </div>
          </div>
        </div>
        <div class="layui-form-item">
          <div class="addreceiptApplyDetailForm-title">
            <h3 class="title">领料明细</h3>
          </div>
          <div class="line"></div>
          <!-- 表格 -->
          <table class="layui-table" id="receiptApplyDetailTable" lay-filter="receiptApplyDetailTable"></table>
        </div>
      </div>
      <div class="layui-form-item text-right">
        <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button>
      </div>
    </div>
  </form>
</script>

<!-- 领料记录审核、详情弹窗 -->
<script type="text/html" id="receiptRecordEditForm">
  <form lay-filter="receiptRecordEditForm" class="layui-form open-form">
    <div class="open-model">
      <div class="open-auto">
        <input name="id" type="hidden" />
        <div class="layui-col-xs4">
          <div class="layui-form-item">
            <label class="layui-form-label">领料类型</label>
            <div class="layui-input-block">
              <input name="inventoryTypeName" type="text" class="layui-input" disabled />
            </div>
          </div>
        </div>
        <div class="layui-col-xs4">
          <div class="layui-form-item">
            <label class="layui-form-label">开工单编号</label>
            <div class="layui-input-block">
              <input name="workOrderCode" type="text" class="layui-input" disabled />
            </div>
          </div>
        </div>
        <div class="layui-col-xs4">
          <div class="layui-form-item">
            <label class="layui-form-label">工站任务编号</label>
            <div class="layui-input-block">
              <input name="productionProcessDeviceCode" type="text" class="layui-input" disabled />
            </div>
          </div>
        </div>
        <div class="layui-col-xs4">
          <div class="layui-form-item">
            <label class="layui-form-label">所属计划</label>
            <div class="layui-input-block">
              <input name="productionPlanCode" type="text" class="layui-input" disabled />
            </div>
          </div>
        </div>
        <div class="layui-col-xs4">
          <div class="layui-form-item">
            <label class="layui-form-label">仓库类型</label>
            <div class="layui-input-block">
              <input name="warehouseTypeName" type="text" class="layui-input" disabled />
            </div>
          </div>
        </div>
        <div class="layui-col-xs4">
          <div class="layui-form-item">
            <label class="layui-form-label">领料仓库</label>
            <div class="layui-input-block">
              <input name="receiptWarehouseName" type="text" class="layui-input" disabled />
            </div>
          </div>
        </div>
        <div class="layui-col-xs4">
          <div class="layui-form-item">
            <label class="layui-form-label">领料料号数</label>
            <div class="layui-input-block">
              <input name="receiptNum" type="text" class="layui-input" disabled />
            </div>
          </div>
        </div>
        <!--         <div class="layui-col-xs4">
                             <div class="layui-form-item">
                                 <label class="layui-form-label">审核人</label>
                                 <div class="layui-input-block">
                                     <input name="auditPersonName" type="text" class="layui-input" disabled />
                                 </div>
                             </div>
                         </div>-->
        <div class="layui-col-xs4">
          <div class="layui-form-item">
            <label class="layui-form-label">领料人</label>
            <div class="layui-input-block">
              <input name="creatorName" type="text" class="layui-input" disabled />
            </div>
          </div>
        </div>
        <div class="layui-col-xs4">
          <div class="layui-form-item">
            <label class="layui-form-label">描述</label>
            <div class="layui-input-block">
              <input name="remark" type="text" class="layui-input" disabled />
            </div>
          </div>
        </div>
        <!--       <div class="layui-col-xs4">
                           <div class="layui-form-item">
                               <label class="layui-form-label">审核结果</label>
                               <div class="layui-input-block">
                                   <textarea name="auditResult" placeholder="请输入审核结果" maxlength="200" class="layui-textarea"></textarea>
                               </div>
                           </div>
                       </div>-->
        <div class="layui-form-item">
          <div class="addReceiptRecordDetailForm-title" style="margin-left: 0;">
            <h3 class="title">领料明细</h3>
          </div>
          <div class="line"></div>
          <!-- 表格 -->
          <table class="layui-table" id="receiptRecordDetailEditTable" lay-filter="receiptRecordDetailEditTable"></table>
        </div>
      </div>
    </div>
  </form>
</script>

<!-- 领料记录审核、详情弹窗 -->
<script type="text/html" id="receiptRecordEditFormQiTa">
  <form lay-filter="receiptRecordEditFormQiTa" class="layui-form open-form">
    <div class="open-model">
      <div class="open-auto">
        <input name="id" type="hidden" />
        <div class="layui-col-xs4">
          <div class="layui-form-item">
            <label class="layui-form-label">类型</label>
            <div class="layui-input-block">
              <input name="inventoryTypeName" type="text" class="layui-input" readonly />
            </div>
          </div>
        </div>
        <!--   <div class="layui-col-xs4">
                     <div class="layui-form-item">
                       <label class="layui-form-label">开工单编号</label>
                       <div class="layui-input-block">
                         <input name="workOrderCode" type="text" class="layui-input" readonly />
                       </div>
                     </div>
                   </div>-->
        <!--  <div class="layui-col-xs4">
                    <div class="layui-form-item">
                      <label class="layui-form-label">工站任务编号</label>
                      <div class="layui-input-block">
                        <input name="productionProcessDeviceCode" type="text" class="layui-input" readonly />
                      </div>
                    </div>
                  </div>-->

        <div class="layui-col-xs4">
          <div class="layui-form-item">
            <label class="layui-form-label">料号数</label>
            <div class="layui-input-block">
              <input name="receiptNum" type="text" class="layui-input" readonly />
            </div>
          </div>
        </div>
        <div class="layui-col-xs4">
          <div class="layui-form-item">
            <label class="layui-form-label">审核人</label>
            <div class="layui-input-block">
              <input name="auditPersonName" type="text" class="layui-input" readonly />
            </div>
          </div>
        </div>
        <div class="layui-col-xs4">
          <div class="layui-form-item">
            <label class="layui-form-label">出库人</label>
            <div class="layui-input-block">
              <input name="creatorName" type="text" class="layui-input" readonly />
            </div>
          </div>
        </div>
        <div class="layui-col-xs4">
          <div class="layui-form-item">
            <label class="layui-form-label">描述</label>
            <div class="layui-input-block">
              <input name="remark" type="text" class="layui-input" />
            </div>
          </div>
        </div>
        <div class="layui-form-item">
          <div class="addReceiptRecordDetailForm-title" style="margin-left: 0;">
            <h3 class="title">其他出库明细</h3>
          </div>
          <div class="line"></div>
          <!-- 表格 -->
          <table class="layui-table" id="receiptRecordDetailQiTaEditTable" lay-filter="receiptRecordDetailQiTaEditTable"></table>
        </div>
      </div>
    </div>
  </form>
</script>

<!-- js部分 -->
<script>
  layui.use(["layer", "form", "table", "admin", "config", "laydate"], async function () {
    var $ = layui.jquery;
    var layer = layui.layer;
    var table = layui.table;
    var form = layui.form;
    var config = layui.config;
    var admin = layui.admin;
    var laydate = layui.laydate;
    let nowData = {};
    let where = {};
    if (typeof parentData !== "undefined") {
      nowData = { ...parentData };
      if (nowData.eventName == "radio" || nowData.eventName == "checkbox") {
        $("#configFunByapply").show();
        where = nowData.where;
      }
    }
    laydate.render({
      elem: '#pTime',
      type: 'date',
      range: true,
      done: function (value, date, endDate) {
        if (value) {
          var dateValue = value.split(" - ");
          $("input[name='startCreateTime']").val(dateValue[0] + " 00:00:00");
          $("input[name='endCreateTime']").val(dateValue[1] + " 23:59:59");
        } else {
          $("input[name='startCreateTime']").val("");
          $("input[name='endCreateTime']").val("");
        }
      }
    });
    /*await admin.initDataSelectPro("enterprisecab/warehouse/admin/warehouseInventoryType/list", {
      status: 'enable',
      inventoryType: 'out',
      limit: '999'
    }, "inventoryTypeId", "出库类型");*/

    //所属物料列表
    admin.initDataSelect("enterprise/product/admin/productDetail/list", null, "productDetailId", null, "所属物料", "skuName", null);
    //物料选择事件-所属工序列表
    form.on("select(productDetailId)", function (selectData) {
      $("#processId").empty();
      admin.initDataSelect("enterprise/echnologyParam/admin/echnologyParam/list", { productDetailId: selectData.value }, "processId", null, "所属工序", null, null);
    });

    // 渲染表格
    var insTb = table.render({
      id: "#receiptApplyTable",
      elem: "#receiptApplyTable",
      url: config.base + "enterprise/storage/admin/receiptApply1/list",
      where: { ...where },
      page: true,
      cellMinWidth: 100,
      cols: [
        [
          {
            type: "radio",
            hide: nowData.eventName == "radio" ? false : true
          },
          { type: "numbers", title: "序号", align: "center" },
          { field: "code", title: "出库任务单编号", align: "center", width: 160 },
          { field: "inventoryTypeName", title: "出库类型", align: "center", width: 150 },
          { field: "workOrderCode", title: "所属工单", align: "center", width: 150 },
          // , {field: 'processCode', title: '制造令编号', align: 'center', width: 150}
          // , {field: 'productionPlanCode', align: 'center', title: '所属计划', width: 150}
          // , {field: 'receiptWarehouseName', align: 'center', title: '出库仓库'}
          // , {field: 'warehouseTypeName', align: 'center', title: '仓库性质'}
          { field: "receiptNum", align: "center", title: "出库料号数" },
          { field: "remark", align: "center", title: "出库备注" },
          { field: "statusName", align: "center", title: "状态" },
          // , {field: 'auditPersonName', align: 'center', title: '审核人'}
          { field: "creatorName", align: "center", title: "创建人" },
          { field: "createTime", align: "center", title: "创建时间", width: 160 },
          { align: "center", toolbar: "#receiptApplyTabBar", title: "操作", width: 220 }
        ]
      ],
      done: function (res, curr, count) {}
    });

    //初始化产品类别
    // admin.initDataSelectTree(true, "enterprise/product/admin/productType/getTreeData", { limit: 99999 }, "productType", null, "产品类别", "productTypeId", function (row) {
    //   $("input[name='productTypeId']").val(row.arr[0].value);
    // });

    //渲染下拉
    form.render("select");

    $("#configFunByapply").click(function () {
      let list = table.checkStatus("#receiptApplyTable").data;
      childData.list = list;
      layer.close(nowData.zindex);
    });
    // 工具条点击事件
    table.on("tool(receiptApplyTable)", function (obj) {
      let data = obj.data;
      console.log("data", data);
      if (obj.event === "detail") {
        //详情  这里todo详情 用来展示不是领料记录的 主要是 成品销售出库 和 生产订单出库2
        if (data.inventoryTypeCode != undefined && data.inventoryTypeCode == "SCC") {
          showModelLingLiao(data);
        } else if (data.inventoryTypeCode != undefined && data.inventoryTypeCode == "QTC") {
          showModelQiTa(data);
        } else if (data.inventoryTypeCode != undefined && data.inventoryTypeCode == "DBC") {
          showModelLingLiao(data);

          // admin.req("enterprise/sell/admin/deliveryRecord/detail/" + data.workOrderId, {}, (res) => {
          //   if (res.code === 200) {
          //     admin.formOpen({
          //       area: ["90%", "85%"],
          //       offset: "50px",
          //       title: "出库任务详情",
          //       path: "components/sell/deliveryRecordForm.html",
          //       success() {
          //         parentData.eventName = "detail";
          //         parentData.data = res.data;
          //       }
          //     });
          //   }
          // });
        } else {
          admin.req("enterprise/sell/admin/deliveryRecord/detail/" + data.workOrderId, {}, (res) => {
            if (res.code === 200) {
              admin.formOpen({
                area: ["90%", "85%"],
                offset: "50px",
                title: "出库任务详情",
                path: "components/sell/deliveryRecordForm.html",
                success() {
                  parentData.eventName = "detail";
                  parentData.data = res.data;
                }
              });
            }
          });
        }
      } else if (obj.event === "outbound") {
        admin.formOpen({
          area: ["90%", "90%"],
          offset: ["30px", "5%"],
          title: "添加出库作业",
          path: "components/storage/productStorageWorkOutForm.html",
          success: function () {
            parentData.eventName = "outbound";
            parentData.data = data;
          },
        });
      }
    });

    //监听排序
    table.on("sort(receiptApplyTable)", function (obj) {
      table.reload("receiptApplyTable", {
        initSort: obj,
        where: {
          sort: obj.field,
          order: obj.type
        }
      });
    });

    // 搜索
    form.on("submit(formSubSearchLog)", function (data) {
      insTb.reload({ where: data.field, page: { curr: 1 } }, "data");
    });

    // 重置搜索
    form.on("submit(resets)", (data) => {
      $(".lay-header").find("select").val("");
      $(".lay-header").find("input").val("");
      let field = data.field;
      for (let key in field) {
        field[key] = "";
      }
      insTb.reload({ where: field, page: { curr: 1 } }, "data");
    });

    // 领料记录审核、详情弹窗
    function showModelLingLiao(data) {
      admin.open({
        type: 1,
        area: ["1500px", "90%"],
        style: "font-size: 20px;",
        title: "出库任务详情",
        content: $("#receiptRecordEditForm").html(),
        success: function () {
          //领料记录数据回显
          form.val("receiptRecordEditForm", data);
          form.render();
          //领料明细表格
          table.render({
            elem: "#receiptRecordDetailEditTable",
            data: data.receiptRecordDetailList,
            cellMinWidth: 100,
            page: false,
            cols: [
              [
                { type: "numbers", width: 50, title: "序号" },
                { field: "skuCode", title: "物料编码", align: "center" },
                { field: "skuName", title: "物料名称", align: "center", width: 150 },
                { field: "skuSpec", title: "物料规格", align: "center", width: 150 },
                { field: "materialNatureName", title: "物料类别性质", align: "center", width: 140 },
                { field: "productTypeName", title: "物料类别", align: "center", width: 140 },
                { field: "baseUnitName", title: "基础单位", align: "center" },
                { field: "unitName", title: "计量单位", align: "center" },
                { field: "receiptNum", title: "领取数量", align: "center", width: 140, edit: "text" },
                { field: "remark", title: "备注", align: "center", width: 160, edit: "text" }
              ]
            ]
          });

          //审核通过
          form.on("submit(auditSuccessBtn)", function (data) {
            data.field.status = 2; //待领料
            // 更新
            admin.req(
              "enterprise/receiptRecord/admin/receiptRecord/update",
              data.field,
              function (res) {
                layer.closeAll("loading");
                if (res.code == 200) {
                  layer.msg(res.msg, { icon: 1 });
                  layer.closeAll();
                  insTb.reload("receiptRecordTable");
                } else {
                  layer.msg(res.msg, { icon: 2 });
                }
              },
              "POST"
            );
            return false;
          });

          //审核驳回
          form.on("submit(auditFailBtn)", function (data) {
            data.field.status = 4; //驳回
            // 更新
            admin.req(
              "enterprise/receiptRecord/admin/receiptRecord/update",
              data.field,
              function (res) {
                layer.closeAll("loading");
                if (res.code == 200) {
                  layer.msg(res.msg, { icon: 1 });
                  layer.closeAll();
                  insTb.reload("receiptRecordTable");
                } else {
                  layer.msg(res.msg, { icon: 2 });
                }
              },
              "POST"
            );
            return false;
          });
        },
        finish: function () {
          table.reload("receiptRecordTable", {});
        }
      });
    }

    // 其他出库 详情弹窗
    function showModelQiTa(data, type) {
      admin.open({
        type: 1,
        area: ["1500px", "90%"],
        style: "font-size: 20px;",
        title: "出库记录详情",
        content: $("#receiptRecordEditFormQiTa").html(),
        success: function () {
          //领料记录数据回显
          form.val("receiptRecordEditFormQiTa", data);
          form.render();
          //领料明细表格
          table.render({
            elem: "#receiptRecordDetailQiTaEditTable",
            data: data.receiptRecordDetailList,
            cellMinWidth: 100,
            page: false,
            cols: [
              [
                { type: "numbers", width: 50, title: "序号" },
                { field: "skuCode", title: "物料编码", align: "center" },
                { field: "skuName", title: "物料名称", align: "center", width: 150 },
                { field: "skuSpec", title: "物料规格", align: "center", width: 150 },
                { field: "materialNatureName", title: "物料类别性质", align: "center", width: 140 },
                { field: "productTypeName", title: "物料类别", align: "center", width: 140 },
                { field: "baseUnitName", title: "基础单位", align: "center" },
                { field: "unitName", title: "计量单位", align: "center" },
                { field: "receiptNum", title: "出库数量", align: "center", width: 140, edit: "text" },
                { field: "remark", title: "备注", align: "center", width: 160, edit: "text" }
              ]
            ]
          });

          //审核通过
          form.on("submit(auditSuccessBtn)", function (data) {
            data.field.status = 2; //待领料
            // 更新
            admin.req(
              "enterprise/receiptRecord/admin/receiptRecordOther/update",
              data.field,
              function (res) {
                layer.closeAll("loading");
                if (res.code == 200) {
                  layer.msg(res.msg, { icon: 1 });
                  layer.closeAll();
                  insTb.reload("receiptRecordTable");
                } else {
                  layer.msg(res.msg, { icon: 2 });
                }
              },
              "POST"
            );
            return false;
          });

          //审核驳回
          form.on("submit(auditFailBtn)", function (data) {
            data.field.status = 4; //驳回
            // 更新
            admin.req(
              "enterprise/receiptRecord/admin/receiptRecord/update",
              data.field,
              function (res) {
                layer.closeAll("loading");
                if (res.code == 200) {
                  layer.msg(res.msg, { icon: 1 });
                  layer.closeAll();
                  insTb.reload("receiptRecordTable");
                } else {
                  layer.msg(res.msg, { icon: 2 });
                }
              },
              "POST"
            );
            return false;
          });
        },
        finish: function () {
          table.reload("receiptRecordTable", {});
        }
      });
    }

    // 领料申请单审核、详情弹窗
    function showModel(data) {
      admin.open({
        type: 1,
        area: ["1500px", "90%"],
        style: "font-size: 20px;",
        title: "领料申请单详情",
        content: $("#receiptApplyEditForm").html(),
        success: function () {
          //领料申请单数据回显
          form.val("receiptApplyEditForm", data);
          form.render();
          //领料明细表格
          table.render({
            elem: "#receiptApplyDetailTable",
            data: data.receiptRecordDetailList,
            cellMinWidth: 100,
            page: false,
            cols: [
              [
                { type: "numbers", width: 50, title: "序号" },
                { field: "skuCode", title: "物料编码", align: "center" },
                { field: "skuName", title: "物料名称", align: "center", width: 150 },
                { field: "skuSpec", title: "物料规格", align: "center", width: 150 },
                { field: "materialNatureName", title: "物料类别性质", align: "center", width: 140 },
                { field: "productTypeName", title: "物料类别", align: "center", width: 140 },
                { field: "baseUnitName", title: "基础单位", align: "center" },
                { field: "unitName", title: "计量单位", align: "center" },
                { field: "receiptNum", title: "领取数量", align: "center", width: 140, edit: "text" },
                { field: "remark", title: "备注", align: "center", width: 160, edit: "text" }
              ]
            ]
          });
        }
      });
    }
  });
</script>
<style>
  .addReceiptApplyDetailForm-title {
    width: 100%;
    margin-left: 20px;
  }

  .addReceiptApplyDetailForm-title .title,
  .title {
    display: inline-block;
    font-size: 16px;
    font-weight: bold;
    color: #333333;
    line-height: 19px;
    position: relative;
    padding: 6px 0 19px 0;
  }

  .addReceiptApplyDetailForm-title .title:after,
  .title:after {
    content: "";
    display: block;
    position: absolute;
    left: 0;
    bottom: 0;
    width: calc(100% + 6px);
    height: 3px;
    background: #0a8b0a;
  }
</style>
